package com.aaa.service.impl;


import com.aaa.pojo.Emp;
import com.aaa.pojo.Student;
import com.aaa.service.StudentService;
import com.aaa.mapper.StudentMapper;
import com.aaa.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author MI
* @description 针对表【student】的数据库操作Service实现
* @createDate 2023-04-10 09:22:28
*/
@Service
public class StudentServiceImpl implements StudentService{
@Autowired
private  StudentMapper studentMapper;

    @Override
    public Result findbycId(Integer cid) {
        Student student = studentMapper.findbycId(cid);
        return new Result(200,"查询员工信息成功",student);
    }

    @Override
    public Result delete(Integer cid) {
        Student delete = studentMapper.delete(cid);
        return new Result(200,"删除员工信息成功",delete);
    }

    @Override
    public Result save(Student student) {
        Student save = studentMapper.save(student);
        return new Result(200,"添加员工信息成功",save);
    }

    @Override
    public Result update(Student student) {
        Student update = studentMapper.update(student);
        return new Result(200,"更新员工信息成功",update);
    }

    @Override
    public Result findAll() {
        List<Student> all = studentMapper.findAll();
        return new Result(200,"查询员工全部信息成功",all);
    }

}




